/**
 * Copyright  (c) 2009-2010 Wilmar IT Service,  Inc.   
 * All  rights  reserved. 
 */
package com.wilmar.process.entity.vo;

import com.wilmar.process.core.ProcessSystemDeclareKeys;

/**
 * @author MaKuBEX Email:makubexnet@gmail.com
 * @version 1.0.0 May 12, 2010
 * @since 1.0.0
 * 
 */
public abstract class AbstractValueObject implements ValueObject {

	/**
	 * @serialField
	 */
	private static final long serialVersionUID = 7710030273202211006L;

	/**
	 * 默认构造函数
	 */
	public AbstractValueObject() {
		super();
	}

	/**
	 * 将普通字符串转换成html代码(替换其中的换行以及空格字符)
	 * 
	 * @param text
	 *            普通字符串
	 * @return html代码
	 */
	protected String text2html(String text) {
		String html = "";
		if (text != null) {
			html = text;
			html = html.replaceAll("\n",
					ProcessSystemDeclareKeys.HTML_LINE_BREAK);
			html = html.replaceAll(" ", ProcessSystemDeclareKeys.HTML_SPACE);
			html = html.replaceAll("\t", ProcessSystemDeclareKeys.HTML_SPACE
					+ ProcessSystemDeclareKeys.HTML_SPACE
					+ ProcessSystemDeclareKeys.HTML_SPACE
					+ ProcessSystemDeclareKeys.HTML_SPACE);
		}
		return html;
	}
}
